<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout}">
<head>
    <title th:text="药品详情"></title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>

<body class="bg-light">
<div layout:fragment="content">
    <div class="card">
        <div class="card-header">
            <h2 th:text="${drug.name} + ' 详情'"></h2>
        </div>
        <div class="card-body">
            <dl class="row">
                <dt class="col-sm-3">生产商</dt>
                <dd class="col-sm-9" th:text="${drug.manufacturer}"></dd>

                <dt class="col-sm-3">价格</dt>
                <dd class="col-sm-9" th:text="'￥' + ${#numbers.formatDecimal(drug.price, 1, 2)}"></dd>

                <dt class="col-sm-3">规格</dt>
                <dd class="col-sm-9" th:text="${drug.specification}"></dd>

                <dt class="col-sm-3">库存</dt>
                <dd class="col-sm-9" th:text="${drug.stock}"></dd>
            </dl>
            <form th:action="@{/api/drugs}" method="get">
                <button type="submit" class="btn btn-secondary">返回列表</button>
            </form>
        </div>
    </div>
</div>
</body>
</html>